package com.yc.yyds.dao;

import com.yc.yyds.util.DBHelper;

import java.sql.Date;

public class Moviedao {
    public void create(String moviename,String moviedesc,String moviegrade,String movieimage,String moviedate,String area,String type ){
        String sql="insert into movie (moviename,moviedesc,moviegrade,movieimage,moviedate,area,type) values (?,?,?,?,?,?,?)";
        DBHelper.update(sql,moviename,moviedesc,moviegrade,movieimage,moviedate,area,type);
    }
    public void modify(String movieid,String moviename,String moviedesc,String moviegrade,String movieimage,String moviedate,String area,String type ){
        String sql="update movie set moviename=?,moviedesc=?,moviegrade=?,movieimage=?,moviedate=?,area=?,type=? where movieid=?";
        DBHelper.update(sql,moviename,moviedesc,moviegrade,movieimage,moviedate,area,type,movieid);
    }
    public void remove(String movieid){
        String sql="delete from movie where movieid=?";
        DBHelper.update(sql,movieid);
    }
    public void remove1(String movieid){
        String sql="update movie set status = 0 where movieid=?";
        DBHelper.update(sql,movieid);
    }

}
